CreateDraft
Document ShellThe
CreateDraft
method creates a new most recent draft object in this document.
ODDraft CreateDraft (in ODDraft below, in ODBoolean releaseBelow);
below
- A reference to the most recent draft for this document.
releaseBelow
- kODTrue if the
below
draft should be released, otherwisekODFalse
.- return value
- A reference to the newly created draft object with exclusive read/write permissions.
DISCUSSION
This method creates, initializes, and returns a new draft object, which is the most recent draft of this document. (To create the base draft of the document, the document shell calls theAcquireBaseDraft
method instead.)If the
releaseBelow
parameter is true, this document removes its reference to thebelow
draft by calling that draft'sRelease
method.This method initializes the reference count of the returned draft. When the caller has finished using that draft, it should call the draft's
Release
method.EXCEPTIONS
kODErrInvalidBelowDraft
- The document has previous drafts and the
below
draft is not the most recent draft of the document.kODErrInvalidPermissions
- The
below
draft has exclusive read/write permissions, and thereleaseBelow
parameter is false; this combination is illegal because only the most recent draft can have write permission.SEE ALSO
TheODDocument::AcquireDraft
method (page 136).
TheODContainer::AcquireDocument
method (page 100).
TheODRefCntObject::Release
method (page 577).
TheODDraft
class (page 147).
Table 11-1 on page 466 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help